package model

import (
	"github.com/shopspring/decimal"
	"simplifly-tech/consts"
	consts2 "simplifly-tech/payment/consts"
	"time"
)

type PayData struct {
	OrderID       string
	Currency      string
	Amount        decimal.Decimal
	Summary       string
	IncomeID      uint
	Title         string
	Body          string
	NotifyUrl     string
	ReturnUrl     string
	Email         string
	PhoneNumber   string
	LastName      string
	Channel       consts2.SysIncomeChannel
	AirWallexData AirWallexData
}

type AirWallexData struct {
	PayReqDataOrderProducts any //需要传入行程信息
}

type PaymentResponse struct {
	OrderID       string               `json:"orderId"`
	AirWallexData PayAirWallexResponse `json:"airWallex"`
	StripPayData  any                  `json:"stripPayData"`
	YeePayUrl     string               `json:"yeePayUrl"`
}
type PayAirWallexResponse struct {
	AsyncPayment bool             `json:"asyncPayment"`
	PayData      AirWallexPayment `json:"payData"`
}

type NotifyResponse struct {
	PaidAt *time.Time      `json:"paidAt"`
	Paid   decimal.Decimal `json:"paid"`
}

type RefundData struct {
	OrderID        string `json:"orderId"`
	Currency       string
	ParentIncomeID uint            `json:"parentIncomeID"`
	ParentOrderId  string          `json:"parentOrderId"`
	IncomeID       uint            `json:"incomeID"`
	Amount         decimal.Decimal `json:"amount"`
	ReferenceID    string          `json:"referenceID"`
	NotifyUrl      string          `json:"notifyUrl"`
}

type PaymentData struct {
	OrganizationID   uint
	ToOrganizationID uint
	OrderID          string
	OriginOrderID    string
	Title            string
	BillType         consts.AgencyBillType
	Currency         string
	Amount           decimal.Decimal
	ReturnUrl        string
	Channel          consts2.SysIncomeChannel
}
type PaymentNotification struct {
	Status       consts2.NotifyStatus
	OrderID      string
	IncomeID     uint
	PaidAt       time.Time
	PayData      any
	AsyncPayment bool
	ReferenceID  string
}
